package com.ruoyi.system.service.city.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.city.CityTradeMapper;
import com.ruoyi.system.domain.city.CityTrade;
import com.ruoyi.system.service.city.ICityTradeService;

/**
 * 一级行业Service业务层处理
 *
 * @author cjq
 * @date 2023-07-24
 */
@Service
public class CityTradeServiceImpl extends ServiceImpl<CityTradeMapper, CityTrade> implements ICityTradeService {
    @Autowired
    private CityTradeMapper cityTradeMapper;

    /**
     * 查询一级行业
     *
     * @param tradeId 一级行业主键
     * @return 一级行业
     */
    @Override
    public CityTrade selectCityTradeByTradeId(Long tradeId) {
        return cityTradeMapper.selectCityTradeByTradeId(tradeId);
    }

    /**
     * 查询一级行业列表
     *
     * @param cityTrade 一级行业
     * @return 一级行业
     */
    @Override
    public List<CityTrade> selectCityTradeList(CityTrade cityTrade) {
        return cityTradeMapper.selectCityTradeList(cityTrade);
    }

    /**
     * 新增一级行业
     *
     * @param cityTrade 一级行业
     * @return 结果
     */
    @Override
    public int insertCityTrade(CityTrade cityTrade) {
        cityTrade.setCreateTime(DateUtils.getNowDate());
        return cityTradeMapper.insertCityTrade(cityTrade);
    }

    /**
     * 修改一级行业
     *
     * @param cityTrade 一级行业
     * @return 结果
     */
    @Override
    public int updateCityTrade(CityTrade cityTrade) {
        return cityTradeMapper.updateCityTrade(cityTrade);
    }

    /**
     * 批量删除一级行业
     *
     * @param tradeIds 需要删除的一级行业主键
     * @return 结果
     */
    @Override
    public int deleteCityTradeByTradeIds(Long[] tradeIds) {
        return cityTradeMapper.deleteCityTradeByTradeIds(tradeIds);
    }

    /**
     * 删除一级行业信息
     *
     * @param tradeId 一级行业主键
     * @return 结果
     */
    @Override
    public int deleteCityTradeByTradeId(Long tradeId) {
        return cityTradeMapper.deleteCityTradeByTradeId(tradeId);
    }
}
